

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>powerlaw documentation &mdash; powerlaw .8 documentation</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '.8',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="powerlaw .8 documentation" href="#" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="np-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li><a href="#">powerlaw .8 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="powerlaw-documentation">
<h1>powerlaw documentation<a class="headerlink" href="#powerlaw-documentation" title="Permalink to this headline">¶</a></h1>
<p>Below are documentation for the functions and classes in powerlaw. See the
<a class="reference external" href="http://pypi.python.org/pypi/powerlaw">powerlaw home page</a> for more
information and examples.</p>
<div class="toctree-wrapper compound">
<ul class="simple">
</ul>
</div>
<span class="target" id="module-powerlaw"></span><dl class="class">
<dt id="powerlaw.Distribution">
<em class="property">class </em><tt class="descclassname">powerlaw.</tt><tt class="descname">Distribution</tt><big>(</big><em>xmin=1</em>, <em>xmax=None</em>, <em>discrete=False</em>, <em>fit_method='Likelihood'</em>, <em>data=None</em>, <em>parameters=None</em>, <em>parameter_range=None</em>, <em>initial_parameters=None</em>, <em>discrete_approximation='round'</em>, <em>parent_Fit=None</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution" title="Permalink to this definition">¶</a></dt>
<dd><p>An abstract class for theoretical probability distributions. Can be created
with particular parameter values, or fitted to a dataset. Fitting is
by maximum likelihood estimation by default.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>xmin</strong> : int or float, optional</p>
<blockquote>
<div><p>The data value beyond which distributions should be fitted. If
None an optimal one will be calculated.</p>
</div></blockquote>
<p><strong>xmax</strong> : int or float, optional</p>
<blockquote>
<div><p>The maximum value of the fitted distributions.</p>
</div></blockquote>
<p><strong>discrete</strong> : boolean, optional</p>
<blockquote>
<div><p>Whether the distribution is discrete (integers).</p>
</div></blockquote>
<p><strong>data</strong> : list or array, optional</p>
<blockquote>
<div><p>The data to which to fit the distribution. If provided, the fit will
be created at initialization.</p>
</div></blockquote>
<p><strong>fit_method</strong> : &#8220;Likelihood&#8221; or &#8220;KS&#8221;, optional</p>
<blockquote>
<div><p>Method for fitting the distribution. &#8220;Likelihood&#8221; is maximum Likelihood
estimation. &#8220;KS&#8221; is minimial distance estimation using The
Kolmogorov-Smirnov test.</p>
</div></blockquote>
<p><strong>parameters</strong> : tuple or list, optional</p>
<blockquote>
<div><p>The parameters of the distribution. Will be overridden if data is
given or the fit method is called.</p>
</div></blockquote>
<p><strong>parameter_range</strong> : dict, optional</p>
<blockquote>
<div><p>Dictionary of valid parameter ranges for fitting. Formatted as a 
dictionary of parameter names (&#8216;alpha&#8217; and/or &#8216;sigma&#8217;) and tuples 
of their lower and upper limits (ex. (1.5, 2.5), (None, .1)</p>
</div></blockquote>
<p><strong>initial_parameters</strong> : tuple or list, optional</p>
<blockquote>
<div><p>Initial values for the parameter in the fitting search.</p>
</div></blockquote>
<p><strong>discrete_approximation</strong> : &#8220;round&#8221;, &#8220;xmax&#8221; or int, optional</p>
<blockquote>
<div><p>If the discrete form of the theoeretical distribution is not known,
it can be estimated. One estimation method is &#8220;round&#8221;, which sums
the probability mass from x-.5 to x+.5 for each data point. The other
option is to calculate the probability for each x from 1 to N and
normalize by their sum. N can be &#8220;xmax&#8221; or an integer.</p>
</div></blockquote>
<p><strong>parent_Fit</strong> : Fit object, optional</p>
<blockquote class="last">
<div><p>A Fit object from which to use data, if it exists.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<dl class="method">
<dt id="powerlaw.Distribution.KS">
<tt class="descname">KS</tt><big>(</big><em>data=None</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution.KS"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution.KS" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the Kolmogorov-Smirnov distance D between the distribution and
the data. Also sets the properties D+, D-, V (the Kuiper testing
statistic), and Kappa (1 + the average difference between the 
theoretical and empirical distributions).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array, optional</p>
<blockquote class="last">
<div><p>If not provided, attempts to use the data from the Fit object in
which the Distribution object is contained.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Distribution.ccdf">
<tt class="descname">ccdf</tt><big>(</big><em>data=None</em>, <em>survival=True</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution.ccdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution.ccdf" title="Permalink to this definition">¶</a></dt>
<dd><p>The complementary cumulative distribution function (CCDF) of the
theoretical distribution. Calculated for the values given in data
within xmin and xmax, if present.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array, optional</p>
<blockquote>
<div><p>If not provided, attempts to use the data from the Fit object in
which the Distribution object is contained.</p>
</div></blockquote>
<p><strong>survival</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to calculate a CDF (False) or CCDF (True).
True by default.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>X</strong> : array</p>
<blockquote>
<div><p>The sorted, unique values in the data.</p>
</div></blockquote>
<p><strong>probabilities</strong> : array</p>
<blockquote class="last">
<div><p>The portion of the data that is less than or equal to X.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Distribution.cdf">
<tt class="descname">cdf</tt><big>(</big><em>data=None</em>, <em>survival=False</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution.cdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution.cdf" title="Permalink to this definition">¶</a></dt>
<dd><p>The cumulative distribution function (CDF) of the theoretical
distribution. Calculated for the values given in data within xmin and
xmax, if present.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array, optional</p>
<blockquote>
<div><p>If not provided, attempts to use the data from the Fit object in
which the Distribution object is contained.</p>
</div></blockquote>
<p><strong>survival</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to calculate a CDF (False) or CCDF (True).
False by default.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>X</strong> : array</p>
<blockquote>
<div><p>The sorted, unique values in the data.</p>
</div></blockquote>
<p><strong>probabilities</strong> : array</p>
<blockquote class="last">
<div><p>The portion of the data that is less than or equal to X.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Distribution.fit">
<tt class="descname">fit</tt><big>(</big><em>data=None</em>, <em>suppress_output=False</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution.fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution.fit" title="Permalink to this definition">¶</a></dt>
<dd><p>Fits the parameters of the distribution to the data. Uses options set
at initialization.</p>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Distribution.in_range">
<tt class="descname">in_range</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution.in_range"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution.in_range" title="Permalink to this definition">¶</a></dt>
<dd><p>Whether the current parameters of the distribution are within the range
of valid parameters.</p>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Distribution.initial_parameters">
<tt class="descname">initial_parameters</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution.initial_parameters"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution.initial_parameters" title="Permalink to this definition">¶</a></dt>
<dd><p>Return previously user-provided initial parameters or, if never
provided,  calculate new ones. Default initial parameter estimates are
unique to each theoretical distribution.</p>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Distribution.likelihoods">
<tt class="descname">likelihoods</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution.likelihoods"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution.likelihoods" title="Permalink to this definition">¶</a></dt>
<dd><p>The likelihoods of the observed data from the theoretical distribution.
Another name for the probabilities or probability density function.</p>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Distribution.loglikelihoods">
<tt class="descname">loglikelihoods</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution.loglikelihoods"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution.loglikelihoods" title="Permalink to this definition">¶</a></dt>
<dd><p>The logarithm of the likelihoods of the observed data from the
theoretical distribution.</p>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Distribution.parameter_range">
<tt class="descname">parameter_range</tt><big>(</big><em>r</em>, <em>initial_parameters=None</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution.parameter_range"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution.parameter_range" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the limits on the range of valid parameters to be considered while
fitting.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>r</strong> : dict</p>
<blockquote>
<div><p>A dictionary of the parameter range. Restricted parameter 
names are keys, and with tuples of the form (lower_bound,
upper_bound) as values.</p>
</div></blockquote>
<p><strong>initial_parameters</strong> : tuple or list, optional</p>
<blockquote class="last">
<div><p>Initial parameter values to start the fitting search from.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Distribution.pdf">
<tt class="descname">pdf</tt><big>(</big><em>data=None</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution.pdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution.pdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the probability density function (normalized histogram) of the
theoretical distribution for the values in data within xmin and xmax,
if present.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array, optional</p>
<blockquote>
<div><p>If not provided, attempts to use the data from the Fit object in
which the Distribution object is contained.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><strong>probabilities</strong> : array</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Distribution.plot_ccdf">
<tt class="descname">plot_ccdf</tt><big>(</big><em>data=None</em>, <em>ax=None</em>, <em>survival=True</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution.plot_ccdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution.plot_ccdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots the complementary cumulative distribution function (CDF) of the
theoretical distribution for the values given in data within xmin and
xmax, if present. Plots to a new figure or to axis ax if provided.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array, optional</p>
<blockquote>
<div><p>If not provided, attempts to use the data from the Fit object in
which the Distribution object is contained.</p>
</div></blockquote>
<p><strong>ax</strong> : matplotlib axis, optional</p>
<blockquote>
<div><p>The axis to which to plot. If None, a new figure is created.</p>
</div></blockquote>
<p><strong>survival</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to plot a CDF (False) or CCDF (True). True by default.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>ax</strong> : matplotlib axis</p>
<blockquote class="last">
<div><p>The axis to which the plot was made.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Distribution.plot_cdf">
<tt class="descname">plot_cdf</tt><big>(</big><em>data=None</em>, <em>ax=None</em>, <em>survival=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution.plot_cdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution.plot_cdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots the cumulative distribution function (CDF) of the
theoretical distribution for the values given in data within xmin and
xmax, if present. Plots to a new figure or to axis ax if provided.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array, optional</p>
<blockquote>
<div><p>If not provided, attempts to use the data from the Fit object in
which the Distribution object is contained.</p>
</div></blockquote>
<p><strong>ax</strong> : matplotlib axis, optional</p>
<blockquote>
<div><p>The axis to which to plot. If None, a new figure is created.</p>
</div></blockquote>
<p><strong>survival</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to plot a CDF (False) or CCDF (True). False by default.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>ax</strong> : matplotlib axis</p>
<blockquote class="last">
<div><p>The axis to which the plot was made.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Distribution.plot_pdf">
<tt class="descname">plot_pdf</tt><big>(</big><em>data=None</em>, <em>ax=None</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Distribution.plot_pdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Distribution.plot_pdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots the probability density function (PDF) of the
theoretical distribution for the values given in data within xmin and
xmax, if present. Plots to a new figure or to axis ax if provided.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array, optional</p>
<blockquote>
<div><p>If not provided, attempts to use the data from the Fit object in
which the Distribution object is contained.</p>
</div></blockquote>
<p><strong>ax</strong> : matplotlib axis, optional</p>
<blockquote>
<div><p>The axis to which to plot. If None, a new figure is created.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>ax</strong> : matplotlib axis</p>
<blockquote class="last">
<div><p>The axis to which the plot was made.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="powerlaw.Fit">
<em class="property">class </em><tt class="descclassname">powerlaw.</tt><tt class="descname">Fit</tt><big>(</big><em>data</em>, <em>discrete=False</em>, <em>xmin=None</em>, <em>xmax=None</em>, <em>fit_method='Likelihood'</em>, <em>estimate_discrete=True</em>, <em>discrete_approximation='round'</em>, <em>sigma_threshold=None</em>, <em>parameter_range=None</em>, <em>fit_optimizer=None</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Fit" title="Permalink to this definition">¶</a></dt>
<dd><p>A fit of a data set to various probability distributions, namely power
laws. For fits to power laws, the methods of Clauset et al. 2007 are used.
These methods identify the portion of the tail of the distribution that
follows a power law, beyond a value xmin. If no xmin is
provided, the optimal one is calculated and assigned at initialization.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array</p>
<p><strong>discrete</strong> : boolean, optional</p>
<blockquote>
<div><p>Whether the data is discrete (integers).</p>
</div></blockquote>
<p><strong>xmin</strong> : int or float, optional</p>
<blockquote>
<div><p>The data value beyond which distributions should be fitted. If
None an optimal one will be calculated.</p>
</div></blockquote>
<p><strong>xmax</strong> : int or float, optional</p>
<blockquote>
<div><p>The maximum value of the fitted distributions.</p>
</div></blockquote>
<p><strong>estimate_discrete</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to estimate the fit of a discrete power law using fast
analytical methods, instead of calculating the fit exactly with
slow numerical methods. Very accurate with xmin&gt;6</p>
</div></blockquote>
<p><strong>sigma_threshold</strong> : float, optional</p>
<blockquote>
<div><p>Upper limit on the standard error of the power law fit. Used after 
fitting, when identifying valid xmin values.</p>
</div></blockquote>
<p><strong>parameter_range</strong> : dict, optional</p>
<blockquote class="last">
<div><p>Dictionary of valid parameter ranges for fitting. Formatted as a 
dictionary of parameter names (&#8216;alpha&#8217; and/or &#8216;sigma&#8217;) and tuples 
of their lower and upper limits (ex. (1.5, 2.5), (None, .1)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<dl class="method">
<dt id="powerlaw.Fit.ccdf">
<tt class="descname">ccdf</tt><big>(</big><em>original_data=False</em>, <em>survival=True</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Fit.ccdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Fit.ccdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the complementary cumulative distribution function of the data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>original_data</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to use all of the data initially passed to the Fit object.
If False, uses only the data used for the fit (within xmin and
xmax.)</p>
</div></blockquote>
<p><strong>survival</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to return the complementary cumulative distribution
function, also known as the survival function, or the cumulative
distribution function, 1-CCDF.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>X</strong> : array</p>
<blockquote>
<div><p>The sorted, unique values in the data.</p>
</div></blockquote>
<p><strong>probabilities</strong> : array</p>
<blockquote class="last">
<div><p>The portion of the data that is greater than or equal to X.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Fit.cdf">
<tt class="descname">cdf</tt><big>(</big><em>original_data=False</em>, <em>survival=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Fit.cdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Fit.cdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the cumulative distribution function of the data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>original_data</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to use all of the data initially passed to the Fit object.
If False, uses only the data used for the fit (within xmin and
xmax.)</p>
</div></blockquote>
<p><strong>survival</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to return the complementary cumulative distribution
function, 1-CDF, also known as the survival function.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>X</strong> : array</p>
<blockquote>
<div><p>The sorted, unique values in the data.</p>
</div></blockquote>
<p><strong>probabilities</strong> : array</p>
<blockquote class="last">
<div><p>The portion of the data that is less than or equal to X.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Fit.distribution_compare">
<tt class="descname">distribution_compare</tt><big>(</big><em>dist1</em>, <em>dist2</em>, <em>nested=None</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Fit.distribution_compare"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Fit.distribution_compare" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the loglikelihood ratio, and its p-value, between the two
distribution fits, assuming the candidate distributions are nested.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>dist1</strong> : string</p>
<blockquote>
<div><p>Name of the first candidate distribution (ex. &#8216;power_law&#8217;)</p>
</div></blockquote>
<p><strong>dist2</strong> : string</p>
<blockquote>
<div><p>Name of the second candidate distribution (ex. &#8216;exponential&#8217;)</p>
</div></blockquote>
<p><strong>nested</strong> : bool or None, optional</p>
<blockquote>
<div><p>Whether to assume the candidate distributions are nested versions 
of each other. None assumes not unless the name of one distribution
is a substring of the other.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>R</strong> : float</p>
<blockquote>
<div><p>Loglikelihood ratio of the two distributions&#8217; fit to the data. If
greater than 0, the first distribution is preferred. If less than
0, the second distribution is preferred.</p>
</div></blockquote>
<p><strong>p</strong> : float</p>
<blockquote class="last">
<div><p>Significance of R</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Fit.find_xmin">
<tt class="descname">find_xmin</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Fit.find_xmin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Fit.find_xmin" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the optimal xmin beyond which the scaling regime of the power
law fits best. The attribute self.xmin of the Fit object is also set.</p>
<p>The optimal xmin beyond which the scaling regime of the power law fits
best is identified by minimizing the Kolmogorov-Smirnov distance
between the data and the theoretical power law fit.
This is the method of Clauset et al. 2007.</p>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Fit.loglikelihood_ratio">
<tt class="descname">loglikelihood_ratio</tt><big>(</big><em>dist1</em>, <em>dist2</em>, <em>nested=None</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Fit.loglikelihood_ratio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Fit.loglikelihood_ratio" title="Permalink to this definition">¶</a></dt>
<dd><p>Another name for distribution_compare.</p>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Fit.nested_distribution_compare">
<tt class="descname">nested_distribution_compare</tt><big>(</big><em>dist1</em>, <em>dist2</em>, <em>nested=True</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Fit.nested_distribution_compare"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Fit.nested_distribution_compare" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the loglikelihood ratio, and its p-value, between the two
distribution fits, assuming the candidate distributions are nested.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>dist1</strong> : string</p>
<blockquote>
<div><p>Name of the first candidate distribution (ex. &#8216;power_law&#8217;)</p>
</div></blockquote>
<p><strong>dist2</strong> : string</p>
<blockquote>
<div><p>Name of the second candidate distribution (ex. &#8216;exponential&#8217;)</p>
</div></blockquote>
<p><strong>nested</strong> : bool or None, optional</p>
<blockquote>
<div><p>Whether to assume the candidate distributions are nested versions 
of each other. None assumes not unless the name of one distribution
is a substring of the other. True by default.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>R</strong> : float</p>
<blockquote>
<div><p>Loglikelihood ratio of the two distributions&#8217; fit to the data. If
greater than 0, the first distribution is preferred. If less than
0, the second distribution is preferred.</p>
</div></blockquote>
<p><strong>p</strong> : float</p>
<blockquote class="last">
<div><p>Significance of R</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Fit.pdf">
<tt class="descname">pdf</tt><big>(</big><em>original_data=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Fit.pdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Fit.pdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the probability density function (normalized histogram) of the
data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>original_data</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to use all of the data initially passed to the Fit object.
If False, uses only the data used for the fit (within xmin and
xmax.)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>bin_edges</strong> : array</p>
<blockquote>
<div><p>The edges of the bins of the probability density function.</p>
</div></blockquote>
<p><strong>probabilities</strong> : array</p>
<blockquote class="last">
<div><p>The portion of the data that is within the bin. Length 1 less than
bin_edges, as it corresponds to the spaces between them.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Fit.plot_ccdf">
<tt class="descname">plot_ccdf</tt><big>(</big><em>ax=None</em>, <em>original_data=False</em>, <em>survival=True</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Fit.plot_ccdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Fit.plot_ccdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots the CCDF to a new figure or to axis ax if provided.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>ax</strong> : matplotlib axis, optional</p>
<blockquote>
<div><p>The axis to which to plot. If None, a new figure is created.</p>
</div></blockquote>
<p><strong>original_data</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to use all of the data initially passed to the Fit object.
If False, uses only the data used for the fit (within xmin and
xmax.)</p>
</div></blockquote>
<p><strong>survival</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to plot a CDF (False) or CCDF (True). True by default.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>ax</strong> : matplotlib axis</p>
<blockquote class="last">
<div><p>The axis to which the plot was made.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Fit.plot_cdf">
<tt class="descname">plot_cdf</tt><big>(</big><em>ax=None</em>, <em>original_data=False</em>, <em>survival=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Fit.plot_cdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Fit.plot_cdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots the CDF to a new figure or to axis ax if provided.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>ax</strong> : matplotlib axis, optional</p>
<blockquote>
<div><p>The axis to which to plot. If None, a new figure is created.</p>
</div></blockquote>
<p><strong>original_data</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to use all of the data initially passed to the Fit object.
If False, uses only the data used for the fit (within xmin and
xmax.)</p>
</div></blockquote>
<p><strong>survival</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to plot a CDF (False) or CCDF (True). False by default.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>ax</strong> : matplotlib axis</p>
<blockquote class="last">
<div><p>The axis to which the plot was made.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="powerlaw.Fit.plot_pdf">
<tt class="descname">plot_pdf</tt><big>(</big><em>ax=None</em>, <em>original_data=False</em>, <em>linear_bins=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#Fit.plot_pdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.Fit.plot_pdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots the probability density function (PDF) or the data to a new figure
or to axis ax if provided.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>ax</strong> : matplotlib axis, optional</p>
<blockquote>
<div><p>The axis to which to plot. If None, a new figure is created.</p>
</div></blockquote>
<p><strong>original_data</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to use all of the data initially passed to the Fit object.
If False, uses only the data used for the fit (within xmin and
xmax.)</p>
</div></blockquote>
<p><strong>linear_bins</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to use linearly spaced bins (True) or logarithmically
spaced bins (False). False by default.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>ax</strong> : matplotlib axis</p>
<blockquote class="last">
<div><p>The axis to which the plot was made.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="powerlaw.ccdf">
<tt class="descclassname">powerlaw.</tt><tt class="descname">ccdf</tt><big>(</big><em>data</em>, <em>survival=True</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#ccdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.ccdf" title="Permalink to this definition">¶</a></dt>
<dd><p>The complementary cumulative distribution function (CCDF) of the data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array, optional</p>
<p><strong>survival</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to calculate a CDF (False) or CCDF (True). True by default.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>X</strong> : array</p>
<blockquote>
<div><p>The sorted, unique values in the data.</p>
</div></blockquote>
<p><strong>probabilities</strong> : array</p>
<blockquote class="last">
<div><p>The portion of the data that is less than or equal to X.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="powerlaw.cdf">
<tt class="descclassname">powerlaw.</tt><tt class="descname">cdf</tt><big>(</big><em>data</em>, <em>survival=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#cdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.cdf" title="Permalink to this definition">¶</a></dt>
<dd><p>The cumulative distribution function (CDF) of the data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array, optional</p>
<p><strong>survival</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to calculate a CDF (False) or CCDF (True). False by default.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>X</strong> : array</p>
<blockquote>
<div><p>The sorted, unique values in the data.</p>
</div></blockquote>
<p><strong>probabilities</strong> : array</p>
<blockquote class="last">
<div><p>The portion of the data that is less than or equal to X.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="powerlaw.checkunique">
<tt class="descclassname">powerlaw.</tt><tt class="descname">checkunique</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#checkunique"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.checkunique" title="Permalink to this definition">¶</a></dt>
<dd><p>Quickly checks if a sorted array is all unique elements.</p>
</dd></dl>

<dl class="function">
<dt id="powerlaw.cumulative_distribution_function">
<tt class="descclassname">powerlaw.</tt><tt class="descname">cumulative_distribution_function</tt><big>(</big><em>data</em>, <em>xmin=None</em>, <em>xmax=None</em>, <em>survival=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#cumulative_distribution_function"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.cumulative_distribution_function" title="Permalink to this definition">¶</a></dt>
<dd><p>The cumulative distribution function (CDF) of the data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array, optional</p>
<p><strong>survival</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to calculate a CDF (False) or CCDF (True). False by default.</p>
</div></blockquote>
<p><strong>xmin</strong> : int or float, optional</p>
<blockquote>
<div><p>The minimum data size to include. Values less than xmin are excluded.</p>
</div></blockquote>
<p><strong>xmax</strong> : int or float, optional</p>
<blockquote>
<div><p>The maximum data size to include. Values greater than xmin are
excluded.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>X</strong> : array</p>
<blockquote>
<div><p>The sorted, unique values in the data.</p>
</div></blockquote>
<p><strong>probabilities</strong> : array</p>
<blockquote class="last">
<div><p>The portion of the data that is less than or equal to X.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="powerlaw.is_discrete">
<tt class="descclassname">powerlaw.</tt><tt class="descname">is_discrete</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#is_discrete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.is_discrete" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if every element of the array is an integer.</p>
</dd></dl>

<dl class="function">
<dt id="powerlaw.loglikelihood_ratio">
<tt class="descclassname">powerlaw.</tt><tt class="descname">loglikelihood_ratio</tt><big>(</big><em>loglikelihoods1</em>, <em>loglikelihoods2</em>, <em>nested=False</em>, <em>normalized_ratio=False</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#loglikelihood_ratio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.loglikelihood_ratio" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates a loglikelihood ratio and the p-value for testing which of two
probability distributions is more likely to have created a set of
observations.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>loglikelihoods1</strong> : list or array</p>
<blockquote>
<div><p>The logarithms of the likelihoods of each observation, calculated from
a particular probability distribution.</p>
</div></blockquote>
<p><strong>loglikelihoods2</strong> : list or array</p>
<blockquote>
<div><p>The logarithms of the likelihoods of each observation, calculated from
a particular probability distribution.</p>
</div></blockquote>
<p><strong>nested: bool, optional</strong> :</p>
<blockquote>
<div><p>Whether one of the two probability distributions that generated the
likelihoods is a nested version of the other. False by default.</p>
</div></blockquote>
<p><strong>normalized_ratio</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to return the loglikelihood ratio, R, or the normalized
ratio R/sqrt(n*variance)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>R</strong> : float</p>
<blockquote>
<div><p>The loglikelihood ratio of the two sets of likelihoods. If positive, 
the first set of likelihoods is more likely (and so the probability
distribution that produced them is a better fit to the data). If
negative, the reverse is true.</p>
</div></blockquote>
<p><strong>p</strong> : float</p>
<blockquote class="last">
<div><p>The significance of the sign of R. If below a critical values
(typically .05) the sign of R is taken to be significant. If below the
critical value the sign of R is taken to be due to statistical
fluctuations.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="powerlaw.nested_loglikelihood_ratio">
<tt class="descclassname">powerlaw.</tt><tt class="descname">nested_loglikelihood_ratio</tt><big>(</big><em>loglikelihoods1</em>, <em>loglikelihoods2</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#nested_loglikelihood_ratio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.nested_loglikelihood_ratio" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates a loglikelihood ratio and the p-value for testing which of two
probability distributions is more likely to have created a set of
observations. Assumes one of the probability distributions is a nested
version of the other.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>loglikelihoods1</strong> : list or array</p>
<blockquote>
<div><p>The logarithms of the likelihoods of each observation, calculated from
a particular probability distribution.</p>
</div></blockquote>
<p><strong>loglikelihoods2</strong> : list or array</p>
<blockquote>
<div><p>The logarithms of the likelihoods of each observation, calculated from
a particular probability distribution.</p>
</div></blockquote>
<p><strong>nested</strong> : bool, optional</p>
<blockquote>
<div><p>Whether one of the two probability distributions that generated the
likelihoods is a nested version of the other. True by default.</p>
</div></blockquote>
<p><strong>normalized_ratio</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to return the loglikelihood ratio, R, or the normalized
ratio R/sqrt(n*variance)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>R</strong> : float</p>
<blockquote>
<div><p>The loglikelihood ratio of the two sets of likelihoods. If positive, 
the first set of likelihoods is more likely (and so the probability
distribution that produced them is a better fit to the data). If
negative, the reverse is true.</p>
</div></blockquote>
<p><strong>p</strong> : float</p>
<blockquote class="last">
<div><p>The significance of the sign of R. If below a critical values
(typically .05) the sign of R is taken to be significant. If below the
critical value the sign of R is taken to be due to statistical
fluctuations.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="powerlaw.pdf">
<tt class="descclassname">powerlaw.</tt><tt class="descname">pdf</tt><big>(</big><em>data</em>, <em>xmin=None</em>, <em>xmax=None</em>, <em>linear_bins=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#pdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.pdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the probability density function (normalized histogram) of the
data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array</p>
<p><strong>xmin</strong> : float, optional</p>
<blockquote>
<div><p>Minimum value of the PDF. If None, uses the smallest value in the data.</p>
</div></blockquote>
<p><strong>xmax</strong> : float, optional</p>
<blockquote>
<div><p>Maximum value of the PDF. If None, uses the largest value in the data.</p>
</div></blockquote>
<p><strong>linear_bins</strong> : float, optional</p>
<blockquote>
<div><p>Whether to use linearly spaced bins, as opposed to logarithmically
spaced bins (recommended for log-log plots).</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>bin_edges</strong> : array</p>
<blockquote>
<div><p>The edges of the bins of the probability density function.</p>
</div></blockquote>
<p><strong>probabilities</strong> : array</p>
<blockquote class="last">
<div><p>The portion of the data that is within the bin. Length 1 less than
bin_edges, as it corresponds to the spaces between them.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="powerlaw.plot_cdf">
<tt class="descclassname">powerlaw.</tt><tt class="descname">plot_cdf</tt><big>(</big><em>data</em>, <em>ax=None</em>, <em>survival=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#plot_cdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.plot_cdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots the cumulative distribution function (CDF) of the data to a new
figure or to axis ax if provided.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array</p>
<p><strong>ax</strong> : matplotlib axis, optional</p>
<blockquote>
<div><p>The axis to which to plot. If None, a new figure is created.</p>
</div></blockquote>
<p><strong>survival</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to plot a CDF (False) or CCDF (True). False by default.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>ax</strong> : matplotlib axis</p>
<blockquote class="last">
<div><p>The axis to which the plot was made.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="powerlaw.plot_pdf">
<tt class="descclassname">powerlaw.</tt><tt class="descname">plot_pdf</tt><big>(</big><em>data</em>, <em>ax=None</em>, <em>linear_bins=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#plot_pdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.plot_pdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots the probability density function (PDF) to a new figure or to axis ax
if provided.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>data</strong> : list or array</p>
<p><strong>ax</strong> : matplotlib axis, optional</p>
<blockquote>
<div><p>The axis to which to plot. If None, a new figure is created.</p>
</div></blockquote>
<p><strong>linear_bins</strong> : bool, optional</p>
<blockquote>
<div><p>Whether to use linearly spaced bins (True) or logarithmically
spaced bins (False). False by default.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>ax</strong> : matplotlib axis</p>
<blockquote class="last">
<div><p>The axis to which the plot was made.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="powerlaw.trim_to_range">
<tt class="descclassname">powerlaw.</tt><tt class="descname">trim_to_range</tt><big>(</big><em>data</em>, <em>xmin=None</em>, <em>xmax=None</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/powerlaw.html#trim_to_range"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#powerlaw.trim_to_range" title="Permalink to this definition">¶</a></dt>
<dd><p>Removes elements of the data that are above xmin or below xmax (if present)</p>
</dd></dl>

</div>
<div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
<ul class="simple">
<li><a class="reference internal" href="genindex.html"><em>Index</em></a></li>
<li><a class="reference internal" href="py-modindex.html"><em>Module Index</em></a></li>
<li><a class="reference internal" href="search.html"><em>Search Page</em></a></li>
</ul>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="#">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">powerlaw documentation</a><ul>
</ul>
</li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>

  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/index.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="np-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li><a href="#">powerlaw .8 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2013, Jeff Alstott.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>